<template>
	<view class="pub-success">
		<view class="tips">
			<image src="/static/success.png" mode="aspectFill"></image>
			<text class="tips-text">{{activityId?'修改':'发布'}}成功</text>
		</view>
		<view class="go-home" @click="goHome">
			<text>返回首页</text>
		</view>
	</view>
</template>
<script>
export default {
	data() {
		return {
			userType: '',
			activityId: '' // 活动id，修改活动时才会有
		}
	},
	onLoad(options) {
		this.userType = options.type
		this.activityId = options.id
	},
	methods: {
		goHome(){
			let path = ''
			if(this.userType == 2){
				path = '/pages/student/task-page'
			}else{
				path = '/pages/teachers/index'
			}
			uni.switchTab({
				url: path
			})
		}
	}
}
</script>
<style lang="less" scoped>
	.pub-success{
		text-align: center;
		padding-top: 64rpx;
	}
	.tips{
		image{
			width: 128rpx;
			height: 128rpx;
		}
	}
	.tips-text{
		margin-top: 20rpx;
		display: block;
		font-size: 36rpx;
		color: #333333;
	}
	.go-home{
		margin: 98rpx 32rpx 0;
		background-color: #28C2CD;
		border-radius: 20rpx;
		height: 98rpx;
		line-height: 98rpx;
		text-align: center;
		color: #fff;
		font-size: 36rpx;
	}
</style>